package com.chinapost.po;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Tuser entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TUSER", schema = "WDZY", uniqueConstraints = @UniqueConstraint(columnNames = "CNAME"))
public class Tuser implements java.io.Serializable {

	// Fields

	private String cid;
	private Tdept tdept;
	private String cname;
	private String cpwd;
	private Timestamp ccreatedate;
	private Timestamp cmodifydate;
	private Integer clogin;
	private Integer cstate;
	private Timestamp clastlogin;
	private Set<Tzxf> tzxfsForCmodifyuserid = new HashSet<Tzxf>(0);
	private Set<Tywcb> tywcbsForCcreateuserid = new HashSet<Tywcb>(0);
	private Set<Tywcb> tywcbsForCmodifyuserid = new HashSet<Tywcb>(0);
	private Set<Tzxf> tzxfsForCcreateuserid = new HashSet<Tzxf>(0);
	private Set<Trole> troles = new HashSet<Trole>(0);
	private Set<Tygxc> tygxcsForCmodifyuserid = new HashSet<Tygxc>(0);
	private Set<Tfczy> tfcziesForCmodifyuserid = new HashSet<Tfczy>(0);
	private Set<Tygxc> tygxcsForCcreateuserid = new HashSet<Tygxc>(0);
	private Set<Twdry> twdriesForCcreateuserid = new HashSet<Twdry>(0);
	private Set<Twdry> twdriesForCmodifyuserid = new HashSet<Twdry>(0);
	private Set<Tfczy> tfcziesForCcreateuserid = new HashSet<Tfczy>(0);
	private Set<Twdxx> twdxxesForCmodifyuserid = new HashSet<Twdxx>(0);
	private Set<Twdsb> twdsbsForCcreateuserid = new HashSet<Twdsb>(0);
	private Set<Twdsb> twdsbsForCmodifyuserid = new HashSet<Twdsb>(0);
	private Set<Twdxx> twdxxesForCcreateuserid = new HashSet<Twdxx>(0);

	// Constructors

	/** default constructor */
	public Tuser() {
	}

	/** minimal constructor */
	public Tuser(String cid, String cname, String cpwd) {
		this.cid = cid;
		this.cname = cname;
		this.cpwd = cpwd;
	}

	/** full constructor */
	public Tuser(String cid, Tdept tdept, String cname, String cpwd, Timestamp ccreatedate, Timestamp cmodifydate, Integer clogin, Integer cstate, Timestamp clastlogin, Set<Tzxf> tzxfsForCmodifyuserid, Set<Tywcb> tywcbsForCcreateuserid, Set<Tywcb> tywcbsForCmodifyuserid, Set<Tzxf> tzxfsForCcreateuserid, Set<Trole> troles, Set<Tygxc> tygxcsForCmodifyuserid, Set<Tfczy> tfcziesForCmodifyuserid, Set<Tygxc> tygxcsForCcreateuserid, Set<Twdry> twdriesForCcreateuserid, Set<Twdry> twdriesForCmodifyuserid, Set<Tfczy> tfcziesForCcreateuserid, Set<Twdxx> twdxxesForCmodifyuserid, Set<Twdsb> twdsbsForCcreateuserid, Set<Twdsb> twdsbsForCmodifyuserid, Set<Twdxx> twdxxesForCcreateuserid) {
		this.cid = cid;
		this.tdept = tdept;
		this.cname = cname;
		this.cpwd = cpwd;
		this.ccreatedate = ccreatedate;
		this.cmodifydate = cmodifydate;
		this.clogin = clogin;
		this.cstate = cstate;
		this.clastlogin = clastlogin;
		this.tzxfsForCmodifyuserid = tzxfsForCmodifyuserid;
		this.tywcbsForCcreateuserid = tywcbsForCcreateuserid;
		this.tywcbsForCmodifyuserid = tywcbsForCmodifyuserid;
		this.tzxfsForCcreateuserid = tzxfsForCcreateuserid;
		this.troles = troles;
		this.tygxcsForCmodifyuserid = tygxcsForCmodifyuserid;
		this.tfcziesForCmodifyuserid = tfcziesForCmodifyuserid;
		this.tygxcsForCcreateuserid = tygxcsForCcreateuserid;
		this.twdriesForCcreateuserid = twdriesForCcreateuserid;
		this.twdriesForCmodifyuserid = twdriesForCmodifyuserid;
		this.tfcziesForCcreateuserid = tfcziesForCcreateuserid;
		this.twdxxesForCmodifyuserid = twdxxesForCmodifyuserid;
		this.twdsbsForCcreateuserid = twdsbsForCcreateuserid;
		this.twdsbsForCmodifyuserid = twdsbsForCmodifyuserid;
		this.twdxxesForCcreateuserid = twdxxesForCcreateuserid;
	}

	// Property accessors
	@Id
	@Column(name = "CID", unique = true, nullable = false, length = 36)
	public String getCid() {
		return this.cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CDEPTID")
	public Tdept getTdept() {
		return this.tdept;
	}

	public void setTdept(Tdept tdept) {
		this.tdept = tdept;
	}

	@Column(name = "CNAME", unique = true, nullable = false, length = 20)
	public String getCname() {
		return this.cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	@Column(name = "CPWD", nullable = false, length = 32)
	public String getCpwd() {
		return this.cpwd;
	}

	public void setCpwd(String cpwd) {
		this.cpwd = cpwd;
	}

	@Column(name = "CCREATEDATE", length = 11)
	public Timestamp getCcreatedate() {
		return this.ccreatedate;
	}

	public void setCcreatedate(Timestamp ccreatedate) {
		this.ccreatedate = ccreatedate;
	}

	@Column(name = "CMODIFYDATE", length = 11)
	public Timestamp getCmodifydate() {
		return this.cmodifydate;
	}

	public void setCmodifydate(Timestamp cmodifydate) {
		this.cmodifydate = cmodifydate;
	}

	@Column(name = "CLOGIN", precision = 8, scale = 0)
	public Integer getClogin() {
		return this.clogin;
	}

	public void setClogin(Integer clogin) {
		this.clogin = clogin;
	}

	@Column(name = "CSTATE", precision = 5, scale = 0)
	public Integer getCstate() {
		return this.cstate;
	}

	public void setCstate(Integer cstate) {
		this.cstate = cstate;
	}

	@Column(name = "CLASTLOGIN", length = 11)
	public Timestamp getClastlogin() {
		return this.clastlogin;
	}

	public void setClastlogin(Timestamp clastlogin) {
		this.clastlogin = clastlogin;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Tzxf> getTzxfsForCmodifyuserid() {
		return this.tzxfsForCmodifyuserid;
	}

	public void setTzxfsForCmodifyuserid(Set<Tzxf> tzxfsForCmodifyuserid) {
		this.tzxfsForCmodifyuserid = tzxfsForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Tywcb> getTywcbsForCcreateuserid() {
		return this.tywcbsForCcreateuserid;
	}

	public void setTywcbsForCcreateuserid(Set<Tywcb> tywcbsForCcreateuserid) {
		this.tywcbsForCcreateuserid = tywcbsForCcreateuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Tywcb> getTywcbsForCmodifyuserid() {
		return this.tywcbsForCmodifyuserid;
	}

	public void setTywcbsForCmodifyuserid(Set<Tywcb> tywcbsForCmodifyuserid) {
		this.tywcbsForCmodifyuserid = tywcbsForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Tzxf> getTzxfsForCcreateuserid() {
		return this.tzxfsForCcreateuserid;
	}

	public void setTzxfsForCcreateuserid(Set<Tzxf> tzxfsForCcreateuserid) {
		this.tzxfsForCcreateuserid = tzxfsForCcreateuserid;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinTable(name = "TUSER_TROLE", schema = "WDZY", joinColumns = { @JoinColumn(name = "CUSERID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "CROLEID", nullable = false, updatable = false) })
	public Set<Trole> getTroles() {
		return this.troles;
	}

	public void setTroles(Set<Trole> troles) {
		this.troles = troles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Tygxc> getTygxcsForCmodifyuserid() {
		return this.tygxcsForCmodifyuserid;
	}

	public void setTygxcsForCmodifyuserid(Set<Tygxc> tygxcsForCmodifyuserid) {
		this.tygxcsForCmodifyuserid = tygxcsForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Tfczy> getTfcziesForCmodifyuserid() {
		return this.tfcziesForCmodifyuserid;
	}

	public void setTfcziesForCmodifyuserid(Set<Tfczy> tfcziesForCmodifyuserid) {
		this.tfcziesForCmodifyuserid = tfcziesForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Tygxc> getTygxcsForCcreateuserid() {
		return this.tygxcsForCcreateuserid;
	}

	public void setTygxcsForCcreateuserid(Set<Tygxc> tygxcsForCcreateuserid) {
		this.tygxcsForCcreateuserid = tygxcsForCcreateuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Twdry> getTwdriesForCcreateuserid() {
		return this.twdriesForCcreateuserid;
	}

	public void setTwdriesForCcreateuserid(Set<Twdry> twdriesForCcreateuserid) {
		this.twdriesForCcreateuserid = twdriesForCcreateuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Twdry> getTwdriesForCmodifyuserid() {
		return this.twdriesForCmodifyuserid;
	}

	public void setTwdriesForCmodifyuserid(Set<Twdry> twdriesForCmodifyuserid) {
		this.twdriesForCmodifyuserid = twdriesForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Tfczy> getTfcziesForCcreateuserid() {
		return this.tfcziesForCcreateuserid;
	}

	public void setTfcziesForCcreateuserid(Set<Tfczy> tfcziesForCcreateuserid) {
		this.tfcziesForCcreateuserid = tfcziesForCcreateuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Twdxx> getTwdxxesForCmodifyuserid() {
		return this.twdxxesForCmodifyuserid;
	}

	public void setTwdxxesForCmodifyuserid(Set<Twdxx> twdxxesForCmodifyuserid) {
		this.twdxxesForCmodifyuserid = twdxxesForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Twdsb> getTwdsbsForCcreateuserid() {
		return this.twdsbsForCcreateuserid;
	}

	public void setTwdsbsForCcreateuserid(Set<Twdsb> twdsbsForCcreateuserid) {
		this.twdsbsForCcreateuserid = twdsbsForCcreateuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Twdsb> getTwdsbsForCmodifyuserid() {
		return this.twdsbsForCmodifyuserid;
	}

	public void setTwdsbsForCmodifyuserid(Set<Twdsb> twdsbsForCmodifyuserid) {
		this.twdsbsForCmodifyuserid = twdsbsForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Twdxx> getTwdxxesForCcreateuserid() {
		return this.twdxxesForCcreateuserid;
	}

	public void setTwdxxesForCcreateuserid(Set<Twdxx> twdxxesForCcreateuserid) {
		this.twdxxesForCcreateuserid = twdxxesForCcreateuserid;
	}

}